// pages/release/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    time: '12:01',
    date: '2021年05月25日',
    riderCommentList: [{
      value: '发送全员',
      selected: false,
      title: '发送全员'
     }, {
      value: '仅发送给团队管理层',
      selected: false,
       title: '仅发送给团队管理层'
     }, {
      value: '仅发送至团队成员',
      selected: false,
       title: '仅发送至团队成员'
     }, {
      value: '发送投票',
      selected: false,
       title: '发送投票'
     }, {
      value: '发送签到',
      selected: false,
       title: '发送签到'
     }]
  },

  checkboxChange(e) {
    console.log('checkboxChange e:', e);
    let string = "riderCommentList[" + e.target.dataset.index + "].selected"
    this.setData({
     [string]: !this.data.riderCommentList[e.target.dataset.index].selected
    })
    let detailValue = this.data.riderCommentList.filter(it => it.selected).map(it => it.value)
    console.log('所有选中的值为：', detailValue)
   },
  bindDateChange: function (e) {
    console.log('picker发送选择改变，携带值为', e.detail.value)
    this.setData({
      date: e.detail.value
    })
  },

  bindTimeChange: function (e) {
    console.log('picker发送选择改变，携带值为', e.detail.value)
    this.setData({
      time: e.detail.value
    })
  },
  //获取输入
  
  // 发布按钮事件
  confirm: function (e) {
    var that = this;
    console.log(e);
    wx.showModal({
      title: '提示',
      content: '确认发送此日程吗?',
      success: function (res) {
        if (res.confirm) {
          console.log('用户点击确定')
          var FriendId = e.currentTarget.dataset.friendid
          wx.redirectTo({
            url: '../../pages/history/index'
          })
        } else if (res.cancel) {
          console.log('用户点击取消');
        }
      }
    })
  }
})